package org.haredot.mapper;

import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.haredot.dto.TreeNode;
import org.haredot.entity.Role;
import org.springframework.security.core.parameters.P;

import java.util.List;

@Mapper
public interface RoleMapper {
    int deleteByPrimaryKey(Long id);

    int insert(Role record);

    Role selectByPrimaryKey(Long id);

    int updateByPrimaryKey(Role record);

    Role findRoleByName(String name);

    Role findRoleByRemark(String remark);

    List<Role> findAll();

    List<TreeNode> findTreeByRoleId(Long roleId) ;

    int removePermissionByRoleId(Long roleId);

    int batchInsertPermission(@Param("roleId") Long roleId, @Param("nodes") List<String> nodes);
}